package com.company.作业;

import java.util.Scanner;
public class sb {
    public static void main(String[] args) {
        Scanner  in=new Scanner(System.in);
        int[][] grade=new int[3][8];
        for (int i = 0; i < grade.length ; i++) {
            System.out.println("第"+(i+1)+"个选手的号码");
            grade[i][0]=in.nextInt();
            System.out.println("第1个评委的打分:");
            grade[i][1]=in.nextInt();
            System.out.println("第2个评委的打分:");
            grade[i][2]=in.nextInt();
            System.out.println("第3个评委的打分:");
            grade[i][3]=in.nextInt();
            System.out.println("第4个评委的打分:");
            grade[i][4]=in.nextInt();
            System.out.println("第5个评委的打分:");
            grade[i][5]=in.nextInt();
            System.out.println("第6个评委的打分:");
            grade[i][6]=in.nextInt();
            int max=grade[i][1];
            for (int j = 2; j <grade[i].length-3 ; j++) {
                if(max>grade[i][j]){
                    max=grade[i][j];
                }
            }
            int min=grade[i][1];
            for (int j = 2; j <grade[i].length-3 ; j++) {
                if(min<grade[i][j]){
                    min=grade[i][j];
                }
            }
            grade[i][7]=(grade[i][1]+grade[i][2]+grade[i][3]+grade[i][4]+grade[i][5]+grade[i][6]-max-min)/4;
        }
        System.out.println("选手"+" "+"评1"+" "+"评2"+" "+"评3"+" "+"评4"+" "+"评5"+" "+"评6"+" "+"平均分");
        for (int i = 0; i < grade.length ; i++) {
            System.out.println(grade[i][0]+"\t"+grade[i][1]+"\t"+grade[i][2]+"\t"+grade[i][3]+"\t"+grade[i][4]+"\t"+grade[i][5]+"\t"+grade[i][6]+"\t"+grade[i][7]+"\t");
        }
    }

}








